package com.xuecheng.content.domain.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xuecheng.content.domain.model.dto.TeachplanDto;
import com.xuecheng.content.domain.model.entity.Teachplan;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 课程计划 Mapper 接口
 * </p>
 *
 * @author itcast
 */
public interface TeachplanMapper extends BaseMapper<Teachplan> {

    List<TeachplanDto> queryTreeNodesByCourseId(Long courseId);

    Integer queryMaxOrderBy(@Param("parentid") Long parentid, @Param("grade") Integer grade,
                            @Param("courseId") Long courseId);

    Integer queryMinOrderBy(@Param("parentid") Long parentid, @Param("grade") Integer grade,
                            @Param("courseId") Long courseId);

    List<Long> queryNextIds(@Param("parentid") Long parentid, @Param("grade") Integer grade,
                            @Param("courseId") Long courseId, @Param("orderby") Integer orderby);

    void batchUpdateOrderBy(@Param("list") List<Long> teachPlanIds);
}
